<ul class="leftSideBarMenu">
<?php 
	foreach ($categories as $cat):
?>
	<li>
		<a href="<?php echo $this->url->action("category", "Index", "Product", array($cat->id))?>"
            <?php if(empty($cat->subs)){?>class="NoChild"<?php }?>>
			<span><?php echo $cat->name?></span>
		</a>
		<?php if(!empty($cat->subs)):?>
		<ul style="display: none;" class="SubMenu">
			<?php foreach ($cat->subs as $sub):?>
			<li><a href="<?php echo $this->url->action("category", "Index", "Product", array($sub->id))?>"><?php echo $sub->name?></a></li>
		    <?php endforeach;?>
		</ul>
		<?php endif;?>
	</li>
<?php endforeach;?>
</ul>